//Since then
//there is no spring or autumn in the world
//only winter or summer
#pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
#include<map>
#include<set>
#include<cmath>
#include<deque>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<fstream>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
#define ios ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define ull unsigned long long
#define PII pair<int,int>
#define A cout<<"Alice\n";
#define B cout<<"Bob\n";
#define YES cout<<"YES\n";
#define NO cout<<"NO\n";
#define ll long long
using namespace std;
//ll qmi(ll a,ll b){ll res=1;while(b){if(b&1) (res*=a)%=mod;a=a*a%mod;b/=2;}return res;}
int dx[] = {0, 0, -1, 1, -1, 1, -1, 1};
int dy[] = {1, -1, 0, 0, -1, -1, 1, 1};
const float eqa = (1+sqrt(5.0))/2.0;
const float PI = 3.1415926;
const int INF = 0x3f3f3f;
const int mod = 1e9 + 7;
const int N = 1000003;//因为大于十万第一个质数就是1000003

int h[N],e[N],ne[N],idx;
int n;

void insert(int x)
{
    //如果x为负数则为负数，所以加上N保证k必定为正数（k代表hash值）
    int k = (x%N+N)%N;
    e[idx] = x,ne[idx] = h[k],h[k] = idx++;//邻链表插入操作
}

bool find(int x)
{
    int k = (x%N+N)%N;
    for(int i=h[k];i!=-1;i=ne[i])//遍历链表
    {   
        if(e[i]==x) return true;
    }
    return false;
}

int main()
{
    cin>>n;

    memset(h,-1,sizeof h);//清空hash槽

    while(n--)
    {
        char op[2];
        int x;
        cin>>op>>x;
        if(*op=='I') insert(x);
        else {
            if(find(x)) puts("Yes");
            else puts("No");
        }
    }
    return 0;
}